/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.ts.service.impl;

import java.util.Collection;
import java.util.List;

import com.xy.lang.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.ts.domain.bo.ExaminationRecordQuestionBO;
import com.xy.biz.ts.domain.query.ExaminationRecordQuestionQuery;
import com.xy.biz.ts.service.ExaminationRecordQuestionService;
import com.xy.biz.ts.manager.ExaminationRecordQuestionManager;

/**
 *
 *
 * @author yzh
 * @date 2021-4-6
 */
@Service
public class ExaminationRecordQuestionServiceImpl implements ExaminationRecordQuestionService {

	@Autowired
	private ExaminationRecordQuestionManager examinationRecordQuestionManager;

	@Override
	public Result<?> saveExaminationRecordQuestion(ExaminationRecordQuestionBO examinationRecordQuestionBO) {
		int affectedRows = examinationRecordQuestionManager.saveExaminationRecordQuestion(examinationRecordQuestionBO);
		if (affectedRows > 0) {
			return Result.success();
		}
		return Result.ofErrorRowsAffected();
	}

	@Override
	public Result<?> saveAllExaminationRecordQuestion(Collection<ExaminationRecordQuestionBO> collection) {
		int affectedRows = examinationRecordQuestionManager.saveAllExaminationRecordQuestion(collection);
		if (affectedRows > 0) {
			return Result.success();
		}
		return Result.ofErrorRowsAffected();
	}

	@Override
	public Result<?> updateExaminationRecordQuestion(ExaminationRecordQuestionBO examinationRecordQuestionBO) {
		int affectedRows = examinationRecordQuestionManager.updateExaminationRecordQuestion(examinationRecordQuestionBO);
		if (affectedRows > 0) {
			return Result.success();
		}
		return Result.ofErrorRowsAffected();
	}

	@Override
	public Result<?> deleteExaminationRecordQuestion(Long examinationRecordQuestionId) {
		int affectedRows = examinationRecordQuestionManager.deleteExaminationRecordQuestion(examinationRecordQuestionId);
		if (affectedRows > 0) {
			return Result.success();
		}
		return Result.ofErrorRowsAffected();
	}

	@Override
	public ExaminationRecordQuestionBO getExaminationRecordQuestion(Long examinationRecordQuestionId) {
		return examinationRecordQuestionManager.getExaminationRecordQuestion(examinationRecordQuestionId);
	}

	@Override
	public List<ExaminationRecordQuestionBO> listExaminationRecordQuestionById(Collection<Long> collection) {
		return examinationRecordQuestionManager.listExaminationRecordQuestionById(collection);
	}

	@Override
	public List<ExaminationRecordQuestionBO> listExaminationRecordQuestion(ExaminationRecordQuestionQuery query) {
		return examinationRecordQuestionManager.listExaminationRecordQuestion(query);
	}

	@Override
	public int countExaminationRecordQuestion(ExaminationRecordQuestionQuery query) {
		return examinationRecordQuestionManager.countExaminationRecordQuestion(query);
	}

}
